package com.googlecode.figstracter.networks;

import java.util.List;

import org.joone.engine.FullSynapse;
import org.joone.engine.KohonenSynapse;
import org.joone.engine.Layer;
import org.joone.engine.LinearLayer;
import org.joone.engine.SigmoidLayer;
import org.joone.engine.Synapse;
import org.joone.engine.WTALayer;

public class KohonenImageClassifier extends ImageClassifier {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3810396579103919182L;


	public static double DEFAULT_LEARNING_RATE = 0.7;
	public static double DEFAULT_MOMENTUM = 0.5;
	
	public KohonenImageClassifier(int rows, int columns, int classes, int somSize) {
		super(classes);
		int inputSize = 8 + rows*columns*8;
		this.rows = new int [] {
				this.classes,
				inputSize+classes/2 +1,
				somSize*somSize,
				inputSize
		};
		layers = new Layer[] {
				new SigmoidLayer(),
				new SigmoidLayer(),
				new WTALayer(),
				new LinearLayer(),
		};
		synapses = new Synapse[] {
				new FullSynapse(),
				new FullSynapse(),
				new KohonenSynapse()
		};
		((WTALayer)layers[2]).setLayerWidth(somSize);
		((WTALayer)layers[2]).setLayerHeight(somSize);
		setup();
		this.getMonitor().setLearningRate(DEFAULT_LEARNING_RATE);
		this.getMonitor().setMomentum(DEFAULT_MOMENTUM);
	}
	
}
